package stack_quene.stack.quene;

import stack_quene.stack.quene.impl.LinkedQuene;
import stack_quene.stack.quene.impl.LoopQueue;

public class QueueTest {
    public static void main(String[] args) {
//        Queue queue=new LinkedQuene();
//        queue.offer(1);
//        queue.offer(3);
//        queue.offer(5);
//        System.out.println(queue);
//        queue.poll();
//        System.out.println(queue);
//        System.out.println(queue.peek());
        LoopQueue loopQueue=new LoopQueue(4);
        loopQueue.offer(1);
        loopQueue.offer(5);
        loopQueue.offer(3);
        loopQueue.offer(7);
        //front [1,5,3,7] tail
        System.out.println(loopQueue);
        loopQueue.poll();
        //front [5,3,7] tail
        System.out.println(loopQueue);
        //false
        System.out.println(loopQueue.isEmpty());
        loopQueue.offer(9);
        // //front [5,3,7,9] tail  true
        System.out.println(loopQueue.isFull());
        //4
        System.out.println(loopQueue.getSize());
        //9
        System.out.println(loopQueue.getTail());
        //5
        System.out.println(loopQueue.peek());

    }

}
